<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div id="formWrapper" fxFlex="100" fxLayout="column">
    <div fxFlex fxLayout="column" class="content">
        <div>
            <mat-radio-group
                class="radio-group"
                (change)="radioSelectionChange($event)"
                required
            >
                <mat-radio-button
                    class="radio-button"
                    *ngFor="let alternative of staticProperty.alternatives"
                    [value]="alternative"
                    [checked]="alternative.selected"
                    [matTooltip]="alternative.description"
                    [attr.data-cy]="
                        staticProperty.internalName
                            .split(' ')
                            .join('_')
                            .toLowerCase() +
                        '-' +
                        alternative.label.split(' ').join('_').toLowerCase()
                    "
                >
                    <label style="font-weight: normal">
                        {{ alternative.label }}
                    </label>
                </mat-radio-button>
            </mat-radio-group>
        </div>

        <div
            *ngFor="
                let alternative of staticProperty.alternatives;
                let i = index
            "
        >
            <div
                *ngIf="
                    alternative.selected === true &&
                    alternative.staticProperty !== null
                "
            >
                <div style="padding: 0 10px">
                    <sp-app-static-property
                        [adapterId]="adapterId"
                        [completedConfigurations]="
                            completedAlternativeConfigurations
                        "
                        [deploymentConfiguration]="deploymentConfiguration"
                        [eventSchemas]="eventSchemas"
                        [parentForm]="parentForm"
                        [staticProperties]="staticProperties"
                        [fieldName]="
                            fieldName +
                            '-' +
                            alternative.staticProperty.internalName +
                            '-' +
                            i
                        "
                        [staticProperty]="alternative.staticProperty"
                        [displayRecommended]="displayRecommended"
                        (completedConfigurationsEmitter)="
                            handleConfigurationUpdate($event)
                        "
                        class="test fullWidth"
                    >
                    </sp-app-static-property>
                </div>
            </div>
        </div>
    </div>
</div>
